﻿#ifndef YCBASEREQUESTQUEUE_H
#define YCBASEREQUESTQUEUE_H
#include "base/task/taskmanager.h"

QT_BEGIN_NAMESPACE
class QNetworkAccessManager;
QT_END_NAMESPACE

namespace yc {

class RequestQueue : public TaskManager
{
    Q_OBJECT

public:
    explicit RequestQueue(int parallel_count, QObject* parent = Q_NULLPTR);

    QNetworkAccessManager& networkAccessManager() { return *net_mgr_; }
    void cancelRequest(int id);

private:
    QNetworkAccessManager* net_mgr_;
};

} // namespace yc

#endif // YCBASEREQUESTQUEUE_H
